package com.ym.soso.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;


@EnumDescription("发布状态")
public enum PublishStatusEnum implements DictEnum {

	//--------------------start-----------------


	HAS_BEEN_RELEASED("01", "已发布"),
	/**
	 * 否
	 */
	UN_PUBLISHED("00", "未发布"),

	//--------------------end-------------------
	;

	private String key;

	private String value;

	PublishStatusEnum(String key, String value) {
		this.key = key;
		this.value = value;
	}

	@Override
	public String getKey() {
		return this.key;
	}

	@Override
	public String getValue() {
		return this.value;
	}

	/**
	 * 序列化使用
	 */
	public static class Covert extends StdConverter<String, JSONObject> {
		@Override
		public JSONObject convert(String value) {
			return DictEnum.valueOfJson(PublishStatusEnum.class, value);
		}
	}
}
